package com.changlu.aixiaozhi.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,
//        chatModel = "qwenChatModel",
        streamingChatModel = "qwenStreamingChatModel", // 流式模型
        chatMemoryProvider = "chatMemoryProviderXiaozhi",
        tools = "appointmentTools", // tools配置
        contentRetriever = "contentRetrieverXiaozhiPincone" //配置向量存储基于向量数据库
)
public interface XiaozhiAgent {

    // 原始返回字符串
//    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
//    String chat(@MemoryId Long memoryId, @UserMessage String userMessage);

    // 流式返回
    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage);


}